//
//  SearchView.m
//  CarLifes
//
//  Created by yu on 2017/6/26.
//  Copyright © 2017年 jpas. All rights reserved.
//

#import "SearchView.h"

@interface SearchView ()

@end

@implementation SearchView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        self.image = IMAGE_NAMED(@"bg_search");
        self.userInteractionEnabled = YES;
        
        UIImageView *imageView = [[UIImageView alloc] init];
        imageView.image = IMAGE_NAMED(@"home_search");
        [self addSubview:imageView];
        
        UITextField *textField = [[UITextField alloc] init];
        self.textField = textField;
        textField.backgroundColor = [UIColor clearColor];
        textField.font = SYSTEM_FONT(15);
        textField.textColor = [UIColor whiteColor];
        textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"搜索车主名|车架号|设备号|合同号" attributes:@{NSForegroundColorAttributeName:kRgb(125, 125, 125),NSFontAttributeName:SYSTEM_FONT(15)}];
        
        [self addSubview:textField];
        
        imageView.sd_layout
        .leftSpaceToView(self, 15)
        .centerYEqualToView(self)
        .widthIs(19)
        .heightEqualToWidth();
        
        textField.sd_layout
        .leftSpaceToView(imageView, 15)
        .rightSpaceToView(self, 15)
        .centerYEqualToView(self)
        .heightIs(30);
        
    }
    return self;
}


@end
